package com.example.ws;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class GlobalConfLoader {
    private static final String GLOBAL_CONFIG_FILENAME = "gcfg.properties";

    public static final String CONFIG_KEY_SERVER_PORT                   = "server_port";
    public static final String CONFIG_KEY_WEB_PORT                      = "web_port";
    public static final String CONFIG_KEY_SERVER_LOCAL_PATH             = "server_local_path";
    public static final String CONFIG_KEY_REMOTE_LOG_PATH               = "remote_log_path";
    public static final String CONFIG_KEY_ELASTICSEARCH_IP              = "elasticsearch_ip";
    public static final String CONFIG_KEY_ELASTICSEARCH_PORT            = "elasticsearch_port";
    
    private static Properties confProp = null;

    public static Properties getConfprop() {
        return confProp;
    }

    public static Properties load() throws IOException {
        FileInputStream in = new FileInputStream(GLOBAL_CONFIG_FILENAME);
        confProp = new Properties();
        confProp.load(in);
        return confProp;
    }



}
